The real-time rendering of three-dimensional (3D) graphics has a number of appealing applications on mobile terminals, including games, man-machine interfaces, messaging and m-commerce. Since 3D rendering is a computationally expensive task, dedicated hardware must often be built to reach sufficient performance. Innovative ways of lowering the complexity and bandwidth usage of this hardware architecture are thus of great importance.
The main bottleneck, especially for mobile phones, is memory bandwidth. A common technique for reducing memory bandwidth usage is texture encoding or compression. Texturing refers to the process of “gluing” images denoted textures onto the rendered triangles. The textures consist of a number of texture elements or so-called texels in correspondence to picture elements or pixels of a picture. If the textures are encoded in memory, and then during accessing they are decoded or decompressed, a significant amount of bandwidth usage can be avoided.
Most texture processing schemes are concentrating on image-type data, such as photographs. However, with the advent of programmable shaders, textures have started to be used for many other types of data than just traditional photographic images. Bump mapping has therefore become a widespread technique which adds the illusion of detail to geometrical objects in an inexpensive way. More specifically, a texture, called a bump map or normal map, is used at each texel to perturb the surface normal. A common approach to generate normal maps is to start with a high polygon count model and create a low complexity model using some geometrical simplification algorithm. The “difference” between these two models is then “baked” into a normal. For real-time rendering, the normal map is applied to the low complexity model, giving it a more detailed appearance.
Using lower polygon-count models is of course very attractive for mobile devices, since they have lower computational performance than PC and computer systems.
However, one problem is that the texture processing schemes available are created with photographic images in mind and do not work well when the data is something else, such as a normal map. For example, the lossy texture compression algorithm S3 Texture Compression (S3TC), also denoted as DXTC or DXTn in the art, wherein n denotes the version number of the compression algorithm, has been employed for compressing normal maps, however, with block artifacts as a result. See, e.g., U.S. Pat. No. 5,956,431.
In the majority of cases today, bump mapping is performed in local tangent space (X, Y, Z), of each rendering primitive, e.g. a triangle. Since the length of the normal is not of interest, unit normals can be employed. Thus, the problem is to compress triplets (X,Y,Z), where X2+Y2+Z2=1. The simplest scheme, is just to treat X,Y,Z as RGB (Red, Green, Blue) and compress it with S3TC/DXT1, but that gives rather bad quality.
Another way is to only compress X and Y, and then compute Z using equation 1:Z=√{square root over (1−X2−Y2)}  (1)
By concentrating on X and Y it is possible to get a lower distortion. In order to enhance quality further, the compression algorithm version DXT5 can be used. Normally DXT5 is a version of S3TC used for alpha textures, i.e. RGBA textures, where RGB are coded together and the alpha component (A) is coded independently. Thus one approach has been to use the alpha channel to code X and the G channel to code Y. R and B has been unused in order to give maximum quality to G. However, that still does not give enough quality.
Actually, for smooth surfaces it turns out that even uncompressed RGB888/XYZ888 does not give enough quality for some objects. Especially for smooth surfaces, more than eight bits are needed. Improved normal map processing schemes have therefore been proposed in the art. See, e.g., Munkberg et al, High Quality Normal Map Compression, Graphics Hardware (2006), ACM Press, pp. 96-101, and Munkberg et al., Tight Frame Normal Map Compression, Graphics Hardware (2007), ACM Press, pp. 37-40.
However, there is still a need for a texture processing scheme that can used to efficiently encode and compress textures, including normal or bump maps, and decode and decompress encoded textures.